// RasterSaloonDoc.h : interface of the CRasterSaloonDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_RASTERSALOONDOC_H__AEF1E68D_57F1_4592_BA73_2ED496C727D6__INCLUDED_)
#define AFX_RASTERSALOONDOC_H__AEF1E68D_57F1_4592_BA73_2ED496C727D6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "math/KVector3.h"
#include <afxtempl.h>

class CRasterSaloonDoc : public CDocument
{
protected: // create from serialization only
	CRasterSaloonDoc();
	DECLARE_DYNCREATE(CRasterSaloonDoc)

// Attributes
public:
	CArray<KVector3, KVector3&> m_kvTriangles;
	CRect m_rcRange;
	CPoint m_ptOffset;

// Operations
public:
	BOOL IsLit(int x, int y) const { return m_bLitArea[y*(m_rcRange.Width()+1)+x]; }

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRasterSaloonDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	virtual void DeleteContents();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CRasterSaloonDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	void AddTriangle(KVector3 v[3]);
	void Lit();
	void InvalidateView();
	BOOL* m_bLitArea;

// Generated message map functions
protected:
	//{{AFX_MSG(CRasterSaloonDoc)
	afx_msg void OnEditAdd();
	afx_msg void OnFileImport();
	afx_msg void OnFileExport();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RASTERSALOONDOC_H__AEF1E68D_57F1_4592_BA73_2ED496C727D6__INCLUDED_)
